﻿using Microsoft.AspNetCore.SignalR;

namespace NanjingbeiRailwayStation.MessageCenter
{
    /// <summary>
    /// 
    /// </summary>
    public class RealTimeHub:Hub
    {

        /// <summary>
        /// 
        /// </summary>
        public RealTimeHub()
        {
            
        }
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        public override Task OnConnectedAsync()
        {
            return base.OnConnectedAsync();
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="exception"></param>
        /// <returns></returns>
        public override Task OnDisconnectedAsync(Exception? exception)
        {
            return base.OnDisconnectedAsync(exception);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        public  Task BroadcastEventReport(string projectName,  string imei)
        {
            return Clients.All.SendAsync("BroadcastEventReport");
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="projectName"></param>
        /// <param name="message"></param>
        /// <returns></returns>
        public Task BroadcastRealTimeElectricalParameters(string projectName, string imei)
        {
            return Clients.All.SendAsync("BroadcastRealTimeElectricalParameters");
        }

    }
}
